﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using KCBF.Modules.AI.TreeSharp;
using NYTBD;
using Action = KCBF.Modules.AI.TreeSharp.Action;
using D3;

namespace KCBF.Modules.AI.QuestSteps.Substeps
{
    class CheckForNpc : Sequence
    {

        public CheckForNpc(string target)
        {


            AddChild(new WaitContinue(200, rem => false, new ActionAlwaysFail()));
            AddChild(new Action(delegate(object context)
                                        {
                                            if (_Game.GetUnit(target) == null)
                                            {
                                                Game.Print("Couldnt find " + target);
                                                return RunStatus.Success;
                                            }
                                            return RunStatus.Failure;
                                        }));

        }
    }
}
